package com.liuxing.doctor.mapper;

import com.liuxing.doctor.entity.MedicalRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface MedicalRecordMapper {
    int deleteByPrimaryKey(String medicalRecordId);

    int insert(MedicalRecord record);

    int insertSelective(MedicalRecord record);

    MedicalRecord selectByPrimaryKey(String medicalRecordId);

    int updateByPrimaryKeySelective(MedicalRecord record);

    int updateByPrimaryKey(MedicalRecord record);
    /**
     * 查询病人病历
     * @param id
     * @return
     */
    MedicalRecord selectById(@Param("medicalRecordId")int id);

    /**
     * 更新病历信息
     * @param map
     * @return
     */
    int updateMedicalRecord(Map<String,Object> map);

    /**
     * 新建病人病历
     * @param map
     * @return
     */
    int insertMedicalRecord(Map<String,Object> map);

    /**
     * 根据病人id查询病历
     * @param id
     * @return
     */
    List<MedicalRecord> selectByPatientId(@Param("patientId") String id);

    /**
     * 删除病人病历
     * @param patient_id
     * @return 影响记录条数
     */
    int deleteMedicalRecord(String patient_id);

    int insertOneMedicalRecord(MedicalRecord medicalRecord);
}